package com.example.common.res;

import lombok.Data;

@Data
public class CommonResponse  <T>  {
    public static final String SUCCESS="000000";
    public static final String ERROR="999999";

    private String code;
    private T t;

    private CommonResponse(String code,T t){
        this.code = code;
        this.t = t;
    }

    public static<T> CommonResponse success(T t){
        return new CommonResponse(SUCCESS,t);
    }
    public static CommonResponse fail(String errMessage){
        return new CommonResponse(ERROR,errMessage);
    }
    public CommonResponse(){}
}
